import { priority } from "./definetypes"

export const avoidindDirections: Record<DirectionConstant, DirectionConstant[]> = {
    1: [3, 2, 1,8],
    2: [4, 3, 2,1],
    3: [5, 4, 3,2],
    4: [6, 5, 4,3],
    5: [7, 6, 5,4],
    6: [8, 7, 6,5],
    7: [1, 8, 7,6],
    8: [2, 1, 8,7],
}
/**
 *    8 1 2
 *    7   3
 *    6 5 4
 *
 */
export const oppositeDirections: Record<DirectionConstant, DirectionConstant[]> = {
    1: [6, 5, 4],
    2: [7, 6, 5],
    3: [8, 7, 6],
    4: [1, 8, 7],
    5: [2, 1, 8],
    6: [3, 2, 1],
    7: [4, 3, 2],
    8: [5, 4, 3],
}

export const positiveDirections: Record<DirectionConstant, DirectionConstant[]> = {
    5: [6, 5, 4],
    6: [7, 6, 5],
    7: [8, 7, 6],
    8: [1, 8, 7],
    1: [2, 1, 8],
    2: [3, 2, 1],
    3: [4, 3, 2],
    4: [5, 4, 3],
}
/**相邻方向 */
export const adjacent_dirs: { [dir in 0 | DirectionConstant]: (  DirectionConstant)[] } = {
    0: [ 1, 5, 3, 7, 2, 6, 4, 8],
    1: [1, 2, 8, 3, 7],
    2: [ 2, 3, 1],
    3: [ 3, 4, 2, 5, 1],
    4: [ 4, 5, 3],
    5: [ 5, 6, 4, 7, 3],
    6: [ 6, 7, 5],
    7: [ 7, 8, 6, 1, 5],
    8: [ 8, 1, 7],
}
export const fill_structure:Set<StructureConstant>=new Set([STRUCTURE_EXTENSION,STRUCTURE_LAB,STRUCTURE_TOWER])
export const role_crossLevel:Record<RoleName,number>={
    mine: priority.S,
    porter: priority.A,
    upgrader: priority.E,
    filler: priority.SSS,
    worker: priority.D,
    carry: priority.B,
    scout: priority.F,
    claimer: priority.D,
    idaBlue: priority.SS,
    idaRed: priority.SS,
    idaHeal: priority.SS,
    defRed: priority.SS,
    defBlue: priority.SS,
    manager: priority.SSS,
    minex: priority.B,
    helpWorker: priority.B,
    porter_w:  priority.A,
}